package com.zpark.controller;

import com.github.pagehelper.PageInfo;
import com.zpark.entity.Person;
import com.zpark.service.IPersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @PackageName: com.zpark.controller
 * @ClassName: PersonController
 * @Description:
 * @author: RZS
 * @date: 2024/4/30  14:34
 */
@RestController
@RequestMapping("/person")
public class PersonController {

    @Autowired
    private IPersonService personService;

    @GetMapping("/{start}/{num}")
    public PageInfo<List<Person>> limitPage(
            @PathVariable("start") Integer start,
            @PathVariable("num") Integer num){

        return personService.findLimit(start, num);
    }
}
